<template>
  <div>
    <div class="all">
      <div class="header">
        <div class="left" @click.stop="$router.go(-1)">
          <img src="@/../public/images/1671779704879.png" alt="" />
        </div>
        <div class="middle">北京网络科技</div>
      </div>
      <div class="job-box">
        <JobComponent :listItem="listItem" :isJobDetail="true" />
      </div>
      <div class="chat-all">
        <div class="time">昨天 13:29</div>
        <div class="chat-item">
          <div class="img">
            <img src="@/../public/images/1668216788959.png" alt="" />
          </div>
          <div class="text">您好，请问您还在找工作吗？</div>
        </div>
        <div class="chat-item">
          <div class="img">
            <img src="@/../public/images/1668216788959.png" alt="" />
          </div>
          <div class="text">
            看了您的简历觉得您比较符合我
            们公司的标准呢。看了您的简历觉得您比较符合我 们公司的标准呢。
          </div>
          <div class="blank"></div>
        </div>
        <div class="chat-item right">
          <div class="blank"></div>
          <div class="text">您好</div>
          <div class="img">
            <img src="@/../public/images/1668587314171.png" alt="" />
          </div>
        </div>
        <div class="chat-item right">
          <div class="blank"></div>
          <div class="text">是的，还在找的</div>
          <div class="img">
            <img src="@/../public/images/1668587314171.png" alt="" />
          </div>
        </div>
      </div>
      <div class="ipt">
        <input type="text" placeholder="请输入…"/>
        <div class="btn">发送</div>
      </div>
    </div>
  </div>
</template>

<script>
import JobComponent from "@/components/JobComponent.vue";
export default {
  name: "ChatView",
  components: {
    JobComponent,
  },
  data: () => {
    return {
      listItem: {},
    };
  },
  created() {
    this.listItem = JSON.parse(localStorage.getItem("listItem"));
  },
};
</script>

<style lang="scss" scoped>
.all {
  text-align: start;
  background-color: #f4f4f4;
  width: 100vw;
  height: 100vh;
  overflow: scroll;
  .header {
    position: sticky;
    left: 0;
    top: 0;
    width: 100%;
    height: 1rem;
    background-color: #45a93a;
    background-image: linear-gradient(to right, #19be48, #45a93a);
    font-size: 0.36rem;
    font-weight: bold;
    color: #ffffff;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 0.3rem;
    .left {
      width: 0.15rem;
      height: 0.28rem;
    }
    .middle {
      flex-grow: 1;
      text-align: center;
    }
  }
  .job-box {
    width: 6.9rem;
    background: #ffffff;
    box-shadow: 0px 0.06rem 0.21rem 0px rgba(20, 150, 57, 0.22);
    border-radius: 0.2rem;
    margin: 0.3rem auto;
  }
  .chat-all {
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 1rem;
    .time {
      width: 1.2rem;
      height: 0.4rem;
      background: #dcdcdc;
      border-radius: 0.2rem;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 0.2rem;
      color: #ffffff;
      padding: 0 0.1rem;
      margin: 0 auto;
      margin-top: 0.4rem;
      margin-bottom: 0.3rem;
    }
    .chat-item {
      display: flex;
      justify-content: flex-start;
      overflow: hidden;
      margin: 0.3rem 0;
      .img {
        width: 0.6rem;
        min-width: 0.6rem;
        height: 0.6rem;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 0.3rem;
        margin-top: 0.05rem;
      }
      .text {
        background: #ffffff;
        border-radius: 0px 0.2rem 0.2rem 0.2rem;
        padding: 0.22rem;
      }
      .blank {
        width: 2rem;
        min-width: 2rem;
      }
    }
    .right {
      justify-content: flex-end;
      .text {
        border-radius: 0.2rem 0 0.2rem 0.2rem;
        background-color: #45a93a;
      }
    }
  }
  .ipt {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1rem;
    background-color: #ffffff;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    > input {
      width: 5.9rem;
      height: 0.6rem;
      background: #f4f4f4;
      border-radius: 0.2rem;
      outline: none;
      border: none;
      text-indent: 0.2rem;
      color: #BEBDBD;
      font-size: 0.2rem;
    }
    .btn{
      padding: 0 0.3rem;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #149639;
      font-size: 0.3rem;
    }
  }
}
</style>